home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / macros / Emacs / Emacs_Open_Line.bsh < prev    next >
Text File  |  2013-07-28  |  433b  |  19 lines

  1. /**
  2.  * Insert a newline after the caret, without moving the caret. This macro
  3.  * corresponds to the Emacs (open-line) capability.
  4.  */
  5. source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
  6.  
  7. void emacsOpenLine()
  8. {
  9.     caret = textArea.getCaretPosition();
  10.     buffer.insert (caret, "\n");
  11.     // Caret moved. Back it up.
  12.     textArea.goToPrevLine (false);
  13.     textArea.goToEndOfLine (false);
  14. }
  15.  
  16. emacsOpenLine();
  17.  
  18.  
  19.